package com.tianq.home.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 终端原始数据记录对象 sensor
 * 
 * @author tianq
 * @date 2025-05-06
 */
public class Sensor extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 序列号 */
    private Integer id;

    /** 录入时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "录入时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date time;

    /** 温度 */
    @Excel(name = "温度")
    private Double temperature;

    /** 湿度 */
    @Excel(name = "湿度")
    private Double humidity;

    /** 风扇输出（0-1） */
    @Excel(name = "风扇输出", readConverterExp = "0=-1")
    private Double fan;

    public void setId(Integer id) 
    {
        this.id = id;
    }

    public Integer getId() 
    {
        return id;
    }
    public void setTime(Date time) 
    {
        this.time = time;
    }

    public Date getTime() 
    {
        return time;
    }
    public void setTemperature(Double temperature) 
    {
        this.temperature = temperature;
    }

    public Double getTemperature() 
    {
        return temperature;
    }
    public void setHumidity(Double humidity) 
    {
        this.humidity = humidity;
    }

    public Double getHumidity() 
    {
        return humidity;
    }
    public void setFan(Double fan) 
    {
        this.fan = fan;
    }

    public Double getFan() 
    {
        return fan;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("time", getTime())
            .append("temperature", getTemperature())
            .append("humidity", getHumidity())
            .append("fan", getFan())
            .toString();
    }
}
